﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Mobile.Master" CodeBehind="Books_mobile.aspx.vb" Inherits="BooksReviewApp.Books_mobile" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div data-role="content">
    

    <asp:Button ID="btn_AddBook" runat="server" Text="Add Book" CssClass="m-btn purple"
        PostBackUrl="~/Add_Book_mobile.aspx" />
        <br />
        <asp:ListView ID="ListView1" runat="server" DataKeyNames="ID" DataSourceID="SqlDataSource2">
            <LayoutTemplate>
                <ul data-role="listview" data-filter="true">
                      <li runat="server" id="itemPlaceholder" />
                </ul>
            </LayoutTemplate>
            <ItemTemplate >
                <li>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("ID", "BookDetails.aspx?ID={0}") %>' CssClass="NoLinks">
                        <img src='<%# Eval("Thumbnail") %>'  alt="No picture found"  width="100" height="100" style="border-style: solid; border-width: medium" />
                        <h2> <asp:Label ID="lbl_Name" CssClass="BookNameLabel" runat="server" Text='<%# Eval("BookName") %>' /></h2>
                    
                    <p><asp:Label ID="lbl_Category" CssClass="CategoryLabel" runat="server" Text='<%# Eval("Category") %>' /></p>
                    
                    
                        
                    
                    <br />
                   <p> <asp:Label ID="lbl_Time" runat="server" Text='<%# CalculateTime.calculateTimeNoHours(Eval("DateAdded")) %>'
                        ForeColor="#7AC0DA" />
                    •
                    By •
                    <asp:HyperLink ID="HyperLink2" runat="server" Text='<%# Eval("Bibliophile")%>' NavigateUrl='<%# Eval("Bibliophile", "Profile.aspx?Bibliophile={0}") %>'
                        ForeColor="Red" Font-Bold="True" CssClass="red" Font-Size="Smaller">
                        <asp:Label ID="BibliophileLabel" CssClass="BookNameLabel" runat="server" Text='<%# Eval("Bibliophile") %>' />
                    </asp:HyperLink><br />
                     </asp:HyperLink>
                    </p>
                    <br />
                    
                </li>
            </ItemTemplate>
           
        </asp:ListView>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:BooksReviewDBConnectionString1 %>"
            ProviderName="<%$ ConnectionStrings:BooksReviewDBConnectionString1.ProviderName %>" SelectCommand="SELECT * FROM [Books_Categories_View] WHERE IsVerified = 1 ORDER BY DateAdded DESC">
        </asp:SqlDataSource>
        </div>
</asp:Content>
